package com.mmy.service.impl.restaurant;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mmy.dao.restaurant.TRestaurantBaseRepository;
import com.mmy.domain.restaurant.TRestaurantBase;
import com.mmy.service.restaurant.TRestaurantBaseService;

@Service
public class TRestaurantBaseServiceImpl implements TRestaurantBaseService {

	@Autowired
	TRestaurantBaseRepository tRestaurantBaseRepository;

	/**
	 * 获取最大值
	 * 
	 * @return 返回值说明 最大ID
	 * @author 创建人 dingxd
	 * @date 创建日期 2020.11.17
	 */
	public int getMaxRestaurantID() {
		// 流水号
		Object objCode = tRestaurantBaseRepository.getMaxRestaurantID();
		int iID = 0;
		if (objCode != null) {
			iID = Integer.parseInt(objCode.toString());
		}
		return iID;
	}

	/* 创建餐馆基本信息 */
	public void save(int iRestaurantID) {
		// TODO Auto-generated method stub
		tRestaurantBaseRepository.save(iRestaurantID);
	}

	/* 创建 修改餐馆信息 */

	public void save(TRestaurantBase tRestaurantBase) {
		// TODO Auto-generated method stub
		tRestaurantBaseRepository.save(tRestaurantBase);
	}

	/* 通过Id查询 */
	public TRestaurantBase findByRestaurantID(int iRestaurantID) {
		// TODO Auto-generated method stub
		return tRestaurantBaseRepository.findByRestaurantID(iRestaurantID);
	}

	/* 删除餐馆信息 */
	public void deleteChecked(List<Integer> iRestaurantIDs) {
		// TODO Auto-generated method stub
		tRestaurantBaseRepository.deleteChecked(iRestaurantIDs);
	}

}
